﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kokomo.PeInspector.Reflection.Disassembly
{
	/// <summary>
	/// Contains metrics of an MSIL method.
	/// </summary>
	class MsilMetrics
	{
		/// <summary>
		/// Initializes a new <see cref="MsilMetrics"/>.
		/// </summary>
		/// <param name="msilLength">The length of the MSIL.</param>
		/// <param name="blocks">The number of blocks in the MSIL.</param>
		/// <param name="linesOfCode">The number of lines of code.</param>
		/// <param name="cyclomaticComplexity">The cyclomatic complexity of the MSIL.</param>
		public MsilMetrics(
			int msilLength,
			int blocks,
			int linesOfCode,
			int cyclomaticComplexity
			)
		{
			this.MsilLength = msilLength;
			this.Blocks = blocks;
			this.LinesOfCode = linesOfCode;
			this.CyclomaticComplexity = cyclomaticComplexity;
		}

		/// <summary>
		/// Gets the length of the MSIL.
		/// </summary>
		public int MsilLength { get; private set; }
		/// <summary>
		/// Gets the number of blocks in the MSIL.
		/// </summary>
		public int Blocks { get; private set; }
		/// <summary>
		/// Gets the number of lines of code.
		/// </summary>
		public int LinesOfCode { get; private set; }
		/// <summary>
		/// Gets the cyclomatic complexity of the MSIL.
		/// </summary>
		public int CyclomaticComplexity { get; private set; }
	}
}
